// 用来封装所有与组织结构相关的请求

// 导入网络请求对象
import instance from "@/utils/request";

// 获取所有的组织架构
export function companyDepartmentsApi() {
  return instance({
    url: "/company/department"
  });
}

// 删除组织架构
export function delDepartApi(id) {
  return instance({
    url: `/company/department/${id}`,
    method: "delete"
  });
}

// 新增组织架构
export function addDepartApi(data) {
  return instance({
    url: "/company/department",
    method: "post",
    data
  });
}

// 获取部门详情
export function getDepertDetail(id) {
  return instance({
    url: `/company/department/${id}`
  });
}

// 提交编辑数据
export function updateDepartApi(data) {
  return instance({
    url: `/company/department/${data.id}`,
    method: "PUT",
    data
  });
}
